var myApp = new Framework7();
$(".menu").find("#apply").on("click", function () {
    window.location.href = "apply";
});
$(".menu").find("#myApply").on("click", function () {
    window.location.href = "myApply";
});
$(".menu").find("#menuSign").on("click", function () {
    window.location.href = "sign";
});
$(".menu").find("#logout").on("click", function () {
    serviceClean();
});
$(".menu").find("#userLogin").on("click", function () {
    window.location.href = "./";
});
// function cleanSession() {
//     $.ajax({
//         url:'cleanSession',
//         dataType:'json',
//         type:"post",
//         success:function (data) {
//             if(data==200){
//                 $.cookie("user",null);
//                 window.location.href="login";
//             }else{
//                 myApp.alert('','系统错误，请稍后重试');
//             }
//         },
//         error:function (XMLHttpRequest,textStatus,errorThrown) {
//             myApp.alert('','系统错误，请稍后重试');
//         }
//     })
// }
function serviceClean() {
    $.ajax({
        // url:'http://125.65.40.171/conference-check/conventionerController/logout',
        url: 'conventionerController/logout',
        dataType: 'json',
        type: "post",
        xhrFields: {
            withCredentials: true
        },
        success: function (data) {
            if (data.code == 200) {
                console.log("退出登录成功");
                //退出登录，跳转到登录页面
                window.location.href = "./";
                // cleanSession();
            } else {
                myApp.alert('', '系统错误，请稍后重试');
            }
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            myApp.alert('', '系统错误，请稍后重试');
        }
    })
}